/* 转订单去打印页 liys 2021.01.13 */
function printline(){
	if($("#voucher").val() == "" || $("#voucher").val() == null){
			var txt=  "收据号为空，请重新输入";
 			window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error,{onOk:function(){
			$("#voucher").focus();
		}}); 
		return false;
	}
	if($("#receivable").val() == "" || $("#receivable").val() == null){
			var txt=  "应收款为空，请重新输入";
 				window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error,{onOk:function(){
			$("#receivable").focus();
		}}); 
		return false;
	}
	if($("#receipt").val() == "" || $("#receipt").val() == null){
			var txt = "实收款为空，请重新输入";
 				window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error,{onOk:function(){
			$("#receipt").focus();
		}}); 
		return false;
	}
	if($("#payType").val() == "" || $("#payType").val() == null){
			var txt = "付款类型为空，请重新输入";
 				window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error,{onOk:function(){
			$("#payType").focus();
		}});
		return false;
	}
	var objInfoTable = $("#orderNameTel tr");
	var arrOrderLine = [];
	for(var i=0;i<objInfoTable.length;i++){
		if($("#orderName"+ i).val() == "" || $("#orderName"+i).val() == null){
			var txt= "第"+(i+1)+ "位姓名为空，请重新输入";
 				window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error,{onOk:function(){
			$("#orderName"+i).focus();
		}}); 
		return false;
	}
	if($("#orderTel"+ i).val() == "" || $("#orderTel"+i).val() == null){
			var txt= "第"+(i+1)+ "位联系电话为空，请重新输入";
 				window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error,{onOk:function(){
			$("#orderTel"+i).focus();
		}}); 
		return false;
	}
	if(!(/^1[3456789]\d{9}$/.test($("#orderTel"+i).val()))){
	var txt = "第"+(i+1)+"位联系人手机号格式错误，请核对";
	window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error,{onOk:function(){
			$("#orderTel"+i).focus();
		}}); 
	return false;
    }
	if($("#identity"+ i).val() == "" || $("#identity"+i).val() == null){
		var txt= "第"+(i+1)+ "位联身份证为空，请重新输入";
 		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error,{onOk:function(){
		$("#identity"+i).focus();
		}}); 
		return false;
	} 
		var orderLine = {};
		orderLine['orderName'] = $("#orderName" + i).val();
		orderLine['orderTel'] = $("#orderTel" + i).val();
		orderLine['planID'] = $("#planID" + i).val();
		orderLine['ID'] = $("#ID" + i).val();
		orderLine['voucher'] = $("#voucher").val();
		orderLine['receivable'] = $("#receivable").val();
		orderLine['receipt'] = $("#receipt").val();
		orderLine['payType'] = $("#payType").val();
		arrOrderLine.push(orderLine);
	}
	var iID = $("#ID").val();
	$.ajax({
		url:"/mmy/savepayorderline",
		type:"post",
		data:{
			"lineOrder":JSON.stringify(arrOrderLine),
			},
		dataType:"text",
		success:function(data){
			if(data){
				var txt = "转订单成功！";
				window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.success,{onOk:function(){
				location.href="/mmy/printline?iID=" + iID;
				}});
			}else{
				var txt = "转订单失败！";
				window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error,{onOk:function(){
				location.href="/mmy/orderreserd";
				}});
			}
		}
	})
}

function rehidder() {

	window.history.back();
	document.getElementById("checkPopup").style.display = "none";

}

function LinePlace(){
	document.getElementById("PlaceName").style.display = "";
}

function memberName() {
	document.getElementById("checkPopup").style.display = "block";
}

function backPageSize(value){
	location.href="/mmy/backmenu?pageSize=" + value;	
	}	
function frontPageSize(value){
	location.href="/mmy/frontmenu?pageSize=" + value;	
	}	
function permissionPageSize(value){
	location.href="/mmy/permission?pageSize=" + value;	
	}	
	

// 全选
function ckAll() {
	var d = document.getElementById("ckall").checked;
	var cs = document.getElementsByName("ckone");
	for (var i = 0; i < cs.length; i++) {
		cs[i].checked = d;
	}

}
function ckOne() {
	var cs = document.getElementsByName("ckone");
	var total = cs.length; // 总数
	var count = 0;
	for (var i = 0; i < cs.length; i++) {
		if (cs[i].checked) {
			count++
		}
	}
	if (count == total) {
		document.getElementById("ckall").checked = true;
	} else {
		document.getElementById("ckall").checked = false;
	}

}

function ckAll1() {
	var d = document.getElementById("ckall1").checked;
	var cs = document.getElementsByName("ckone1");
	for (var i = 0; i < cs.length; i++) {
		cs[i].checked = d;
	}

}
function ckOne1() {
	var cs = document.getElementsByName("ckone1");
	var total = cs.length; // 总数
	var count = 0;
	for (var i = 0; i < cs.length; i++) {
		if (cs[i].checked) {
			count++
		}
	}
	if (count == total) {
		document.getElementById("ckall1").checked = true;
	} else {
		document.getElementById("ckall1").checked = false;
	}

}

function ckAll2() {
	var d = document.getElementById("ckall2").checked;
	var cs = document.getElementsByName("ckone2");
	for (var i = 0; i < cs.length; i++) {
		cs[i].checked = d;
	}

}
function ckOne2() {
	var cs = document.getElementsByName("ckone2");
	var total = cs.length; // 总数
	var count = 0;
	for (var i = 0; i < cs.length; i++) {
		if (cs[i].checked) {
			count++
		}
	}
	if (count == total) {
		document.getElementById("ckall2").checked = true;
	} else {
		document.getElementById("ckall2").checked = false;
	}

}

function ckAll3() {
	var d = document.getElementById("ckall3").checked;
	var cs = document.getElementsByName("ckone3");
	for (var i = 0; i < cs.length; i++) {
		cs[i].checked = d;
	}

}
function ckOne3() {
	var cs = document.getElementsByName("ckone3");
	var total = cs.length; // 总数
	var count = 0;
	for (var i = 0; i < cs.length; i++) {
		if (cs[i].checked) {
			count++
		}
	}
	if (count == total) {
		document.getElementById("ckall3").checked = true;
	} else {
		document.getElementById("ckall3").checked = false;
	}

}

function ckAll4() {
	var d = document.getElementById("ckall4").checked;
	var cs = document.getElementsByName("ckone4");
	for (var i = 0; i < cs.length; i++) {
		cs[i].checked = d;
	}

}
function ckOne4() {
	var cs = document.getElementsByName("ckone4");
	var total = cs.length; // 总数
	var count = 0;
	for (var i = 0; i < cs.length; i++) {
		if (cs[i].checked) {
			count++
		}
	}
	if (count == total) {
		document.getElementById("ckall4").checked = true;
	} else {
		document.getElementById("ckall4").checked = false;
	}

}



// 删除权限
function delPermission() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delpermission",
			type : "post",
			data : {
				checkList : checklist.toString()

			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")
			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}
// 删除菜单
function delMenu() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delmenu",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}
// 删除权限菜单
function delPermissionMenu() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delpermissionmenu",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除集合地点
function delPlace() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delplace",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}
// 删除物料信息
function delMaterialBase() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delmaterialbase",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除物料入库
function delMaterialIn() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delmaterialin",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除物料出库
function delMaterialOut() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delmaterialout",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除请假类型
function delLeaveType() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delleavetype",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}
// 删除请假记录
function delLeaveInfo() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delleaveinfo",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除车辆公司
function delCarOrg() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delcarorg",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除车辆类型
function delCarType() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delcartype",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除车辆信息
function delCarBase() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delcarbase",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除车辆计划
function delCarPlan() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delcarplan",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}
// 删除激励类型
function delRewardType() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delrewardtype",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除激励记录
function delRewardInfo() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delrewardinfo",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}


// 删除航班信息
function delPlaneBase() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delplanebase",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除机场信息
function delPlaneAirport() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delplaneairport",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除航班时刻信息
function delPlanePlan() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delplaneplan",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除列车信息
function delTrainBase() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/deltrainbase",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除火车站信息
function delTrainStation() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/deltrainstation",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除列车时刻信息
function delTrainPlan() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/deltrainplan",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除船舶公司信息
function delShipOrg() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delshiporg",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除游轮信息
function delShipBase() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delshipbase",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除港口信息
function delShipPort() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delshipport",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}




// 创建权限菜单
function createPermissionMenu() {
	var checkNum = $("input[name='ckone']:checked").length;
	var checkNum1 = $("input[name='ckone1']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		var checklist = new Array();
		$("input[name='ckone']:checked").each(function() {
			checklist.push($(this).val());
		});

		var checklist1 = new Array();
		$("input[name='ckone1']:checked").each(function() {
			checklist1.push($(this).val());
		});

		$.ajax({
			url : "/mmy/savecreatepermissionmenu",
			type : "post",
			data : {
				checkList : checklist.toString(),
				checkList1 : checklist1.toString()
			},
			dataType : "text",
			success : function(data) {

				location.href = "permissionmenu";
				alert("新增成功");
			},
			error : function(XMLHttpRequest, textStatus, errorThrown) {
				alert(XMLHttpRequest.status);
				alert(XMLHttpRequest.readyState);
				alert(textStatus);
			}
		})
	}

}



// 修改菜单
function updateMenu() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/toupdatemenu?iMenuID=" + id;
		}
	}

}

// 前台菜单上移

function upFrontMenu() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		
			var id = $("input[name='ckone']:checked").val();
			
			var url = "/mmy/upfrontmenu?iID=" + id;
			window.location = url;
		
	}

}


//前台菜单下移

function downFrontMenu() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		
			var id = $("input[name='ckone']:checked").val();
			
			var url = "/mmy/downfrontmenu?iID=" + id;
			window.location = url;
		
	}

}

//后台菜单上移

function upBackMenu() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		
			var id = $("input[name='ckone']:checked").val();
			
			var url = "/mmy/upbackmenu?iID=" + id;
			window.location = url;
		
	}

}


//后台菜单下移

function downBackMenu() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		
			var id = $("input[name='ckone']:checked").val();
			
			var url = "/mmy/downbackmenu?iID=" + id;
			window.location = url;
		
	}

}

// 修改权限
function updatePermission() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/toupdatepermission?iRoleID=" + id;
		}
	}

}

// 修改权限菜单
function updatePermissionMenu() {
	

	
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='id']").val();
			location.href = "/mmy/toupdatepermissionmenu?iRoleID=" + id;
		}
	

}

//跳转权限菜单
function permissionMenu() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		
			var id = $("input[name='ckone']:checked").val();
			var url = "/mmy/permissionmenu?iRoleID=" + id;
			window.location = url;
		
	}

}

// 修改集合地点
function updatePlace() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterupdateplace?iPlaceID=" + id;
		}
	}

}
// 修改物料信息
function updateMaterialBase() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterupdatematerialbase?iMaterialID=" + id;
		}
	}

}

// 修改物料入库
function updateMaterialIn() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterupdatematerialin?iInID=" + id;
		}
	}

}

// 修改物料出库
function updateMaterialOut() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterupdatematerialout?iOutID=" + id;
		}
	}

}

// 修改请假类型
function updateLeaveType() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterupdateleavetype?iTypeID=" + id;
		}
	}

}
// 修改请假记录
function updateLeaveInfo() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterupdateleaveinfo?iLeaveID=" + id;
		}
	}

}

// 修改车辆公司
function updateCarOrg() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterupdatecarorg?iOrgID=" + id;
		}
	}

}

// 修改车辆类型
function updateCarType() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterupdatecartype?iTypeID=" + id;
		}
	}

}

// 修改车辆信息
function updateCarBase() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterupdatecarbase?iCarID=" + id;
		}
	}

}

// 修改车辆计划
function updateCarPlan() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterupdatecarplan?iPlanID=" + id;
		}
	}

}

// 修改激励类型
function updateRewardType() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterupdaterewardtype?iTypeID=" + id;
		}
	}

}

// 修改激励记录
function updateRewardInfo() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterupdaterewardinfo?iRewardID=" + id;
		}
	}

}





// 修改航班时刻信息
function updatePlanePlan() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterupdateplaneplan?iPlanID=" + id;
		}
	}

}

// 修改列车信息
function updateTrainBase() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterupdatetrainbase?iTrainID=" + id;
		}
	}

}

// 修改火车站信息
function updateTrainStation() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterupdatetrainstation?iStationID=" + id;
		}
	}

}

// 修改列车时刻信息
function updateTrainPlan() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterupdatetrainplan?iPlanID=" + id;
		}
	}

}

// 修改船舶公司信息
function updateShipOrg() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterupdateshiporg?iOrgID=" + id;
		}
	}

}

// 修改游轮信息
function updateShipBase() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterupdateshipbase?iShipID=" + id;
		}
	}

}

// 修改港口信息
function updateShipPort() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterupdateshipport?iPortID=" + id;
		}
	}

}



// 景点订单

// 修改电子票预留信息
function updateReserveScenicBase() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var scenicid = $("input[name='ScenicID']").val();
			var url = "/mmy/enterupdatereservescenic?iID=" + id;
			url += "&iScenicID=" + scenicid;
			window.location = url;
		}
	}

}

// 修改电子票订单信息
function updateOrderScenicBase() {
	var checkNum = $("input[name='ckone1']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone1']:checked").val();
			var scenicid = $("input[name='ScenicID']").val();
			var url = "/mmy/enterupdateorderscenic?iID=" + id;
			url += "&iScenicID=" + scenicid;
			window.location = url;
		}
	}

}

// 电子票取消预留
function cancelReserveScenic() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要取消预留吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var scenicid = $("input[name='ScenicID']").val();
			var url = "/mmy/entercancelreservescenic?iID=" + id + "&iScenicID="
					+ scenicid;
			// url += "&iScenicID=" + scenicid;
			window.location = url;
		}
	}

}

// 删除取消预留信息
function delReserveScenicBase() {
	var checkNum = $("input[name='ckone3']:checked").length;

	var id = $("input[name='ckone3']:checked").val();
	var scenicid = $("input[name='ScenicID']").val();

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone3']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delreservescenicbase?iID=" + id + "&iScenicID="
					+ scenicid,
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				var url = "/mmy/orderscenic?iScenicID=" + scenicid;
				window.location = url;
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除取消订单信息
function delOrderScenicBase() {
	var checkNum = $("input[name='ckone4']:checked").length;

	var id = $("input[name='ckone4']:checked").val();
	var scenicid = $("input[name='ScenicID']").val();

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone4']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delorderscenicbase?iID=" + id + "&iScenicID="
					+ scenicid,
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				var url = "/mmy/orderscenic?iScenicID=" + scenicid;
				window.location = url;
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 新建电子票预留
function createScenicReserve() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要新建预留么吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterreservescenicbase?iScenicID=" + id;
		}
	}

}

// 转订单收款
function payOrderScenic() {
	var checkNum = $("input[name='ckone']:checked").length;
	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要转订单吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var scenicid = $("input[name='ScenicID']").val();
			var url = "/mmy/enterpayorderscenic?iID=" + id;
			url += "&iScenicID=" + scenicid;
			window.location = url;
		}
	}
}

// 出纳审核
function CashierScenic() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());

				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='CashierState']").val();
				list.push(state);
			});

			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckcashierscenic",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}

// 会计对账
function AccountScenic() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
				
				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='AccountState']").val();
				list.push(state);
			});
			
			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckaccountscenic",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}

// 结账汇款
function RemittanceScenic() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
				
				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='RemittanceState']").val();
				list.push(state);
				
			});
			
			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckremittancescenic",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}

// 车辆订单

// 修改车辆预留信息
function updateReserveCarBase() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var carid = $("input[name='CarID']").val();
			var url = "/mmy/enterupdatereservecar?iID=" + id;
			url += "&iCarID=" + carid;
			window.location = url;
		}
	}

}

// 修改车辆订单信息
function updateOrderCarBase() {
	var checkNum = $("input[name='ckone1']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone1']:checked").val();
			var carid = $("input[name='CarID']").val();
			var url = "/mmy/enterupdateordercar?iID=" + id;
			url += "&iCarID=" + carid;
			window.location = url;
		}
	}

}

// 车辆取消预留
function cancelReserveCar() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要取消预留吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var carid = $("input[name='CarID']").val();
			var url = "/mmy/entercancelreservecar?iID=" + id + "&iCarID="
					+ carid;
			// url += "&iScenicID=" + scenicid;
			window.location = url;
		}
	}

}

// 删除取消预留信息
function delReserveCarBase() {
	var checkNum = $("input[name='ckone3']:checked").length;

	var id = $("input[name='ckone3']:checked").val();
	var carid = $("input[name='CarID']").val();

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone3']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delreservecarbase?iID=" + id + "&iCarID=" + carid,
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				var url = "/mmy/carbaseinfo?iCarID=" + carid;
				window.location = url;
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除取消订单信息
function delOrderCarBase() {
	var checkNum = $("input[name='ckone4']:checked").length;

	var id = $("input[name='ckone4']:checked").val();
	var carid = $("input[name='CarID']").val();

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone4']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delordercarbase?iID=" + id + "&iCarID=" + carid,
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				var url = "/mmy/carbaseinfo?iCarID=" + carid;
				window.location = url;
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 新建车辆预留
function createCarReserve() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要新建预留么吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/reservecar?iCarID=" + id;
		}
	}

}

// 转订单收款
function payOrderCar() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要转订单吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var carid = $("input[name='CarID']").val();
			var url = "/mmy/enterpayordercar?iID=" + id;
			url += "&iCarID=" + carid;
			window.location = url;
		}
	}

}

// 车辆取消订单
function cancelOrderCar() {
	var checkNum = $("input[name='ckone1']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要取消订单吗？")) {
			var id = $("input[name='ckone1']:checked").val();
			var carid = $("input[name='CarID']").val();
			var url = "/mmy/entercancelordercar?iID=" + id;
			url += "&iCarID=" + carid;
			window.location = url;
		}
	}

}



//出纳审核
function CashierCar() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());

				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='CashierState']").val();
				list.push(state);
			});

			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckcashiercar",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}




//会计对账
function AccountCar() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
				
				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='AccountState']").val();
				list.push(state);
			});
			
			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckaccountcar",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}


//结账汇款
function RemittanceCar() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
				
				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='RemittanceState']").val();
				list.push(state);
				
			});
			
			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckremittancecar",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}


// 航班订单

// 修改航班预留信息
function updateReservePlaneBase() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var planeid = $("input[name='PlaneID']").val();
			var url = "/mmy/enterupdatereserveplane?iID=" + id;
			url += "&iPlaneID=" + planeid;
			window.location = url;
		}
	}

}

// 修改航班订单信息
function updateOrderPlaneBase() {
	var checkNum = $("input[name='ckone1']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone1']:checked").val();
			var planeid = $("input[name='PlaneID']").val();
			var url = "/mmy/enterupdateorderplane?iID=" + id;
			url += "&iPlaneID=" + planeid;
			window.location = url;
		}
	}

}

// 航班取消预留
function cancelReservePlane() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要取消预留吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var planeid = $("input[name='PlaneID']").val();
			var url = "/mmy/entercancelreserveplane?iID=" + id + "&iPlaneID="
					+ planeid;
			// url += "&iScenicID=" + scenicid;
			window.location = url;
		}
	}

}

// 删除取消预留信息
function delReservePlaneBase() {
	var checkNum = $("input[name='ckone3']:checked").length;

	var id = $("input[name='ckone3']:checked").val();
	var planeid = $("input[name='PlaneID']").val();

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone3']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$
				.ajax({
					url : "/mmy/delreserveplanebase?iID=" + id + "&iPlaneID="
							+ planeid,
					type : "post",
					data : {
						checkList : checklist.toString()
					},
					dataType : "text",
					success : function(data) {
						var url = "/mmy/planebaseinfo?iPlaneID=" + planeid;
						window.location = url;
						alert("删除成功！")

					},
					error : function(msg) {
						alert("删除失败！")
					}
				})
	}

}

// 删除取消订单信息
function delOrderPlaneBase() {
	var checkNum = $("input[name='ckone4']:checked").length;

	var id = $("input[name='ckone4']:checked").val();
	var planeid = $("input[name='PlaneID']").val();

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone4']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delorderplanebase?iID=" + id + "&iPlaneID=" + planeid,
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				var url = "/mmy/planebaseinfo?iPlaneID=" + planeid;
				window.location = url;
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 新建航班订单预留
function createPlaneReserve() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要新建预留么吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterreserveplanebase?iPlaneID=" + id;
		}
	}

}

// 转订单收款
function payOrderPlane() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要转订单吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var planeid = $("input[name='PlaneID']").val();
			var url = "/mmy/enterpayorderplane?iID=" + id;
			url += "&iPlaneID=" + planeid;
			window.location = url;
		}
	}

}

// 航班取消订单
function cancelOrderPlane() {
	var checkNum = $("input[name='ckone1']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要取消订单吗？")) {
			var id = $("input[name='ckone1']:checked").val();
			var planeid = $("input[name='PlaneID']").val();
			var url = "/mmy/entercancelorderplane?iID=" + id;
			url += "&iPlaneID=" + planeid;
			window.location = url;
		}
	}

}


//出纳审核
function CashierPlane() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());

				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='CashierState']").val();
				list.push(state);
			});

			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckcashierplane",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}



//会计对账
function AccountPlane() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
				
				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='AccountState']").val();
				list.push(state);
			});
			
			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckaccountplane",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}



//结账汇款
function RemittancePlane() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
				
				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='RemittanceState']").val();
				list.push(state);
				
			});
			
			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckremittanceplane",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}




// 船票订单

// 修改船票预留信息
function updateReserveShipBase() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var shipid = $("input[name='ShipID']").val();
			var url = "/mmy/enterupdatereserveship?iID=" + id;
			url += "&iShipID=" + shipid;
			window.location = url;
		}
	}

}

// 修改船票订单信息
function updateOrderShipBase() {
	var checkNum = $("input[name='ckone1']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone1']:checked").val();
			var shipid = $("input[name='ShipID']").val();
			var url = "/mmy/enterupdateordership?iID=" + id;
			url += "&iShipID=" + shipid;
			window.location = url;
		}
	}

}

// 船票取消预留
function cancelReserveShip() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要取消预留吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var shipid = $("input[name='ShipID']").val();
			var url = "/mmy/entercancelreserveship?iID=" + id + "&iShipID="
					+ shipid;
			// url += "&iScenicID=" + scenicid;
			window.location = url;
		}
	}

}

// 删除取消预留信息
function delReserveShipBase() {
	var checkNum = $("input[name='ckone3']:checked").length;

	var id = $("input[name='ckone3']:checked").val();
	var shipid = $("input[name='ShipID']").val();

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone3']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delreserveshipbase?iID=" + id + "&iShipID=" + shipid,
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				var url = "/mmy/shipbaseinfo?iShipID=" + shipid;
				window.location = url;
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除取消订单信息
function delOrderShipBase() {
	var checkNum = $("input[name='ckone4']:checked").length;

	var id = $("input[name='ckone4']:checked").val();
	var shipid = $("input[name='ShipID']").val();

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone4']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delordershipbase?iID=" + id + "&iShipID=" + shipid,
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				var url = "/mmy/shipbaseinfo?iShipID=" + shipid;
				window.location = url;
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 新建船票订单预留
function createShipReserve() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要新建预留么吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterreserveshipbase?iShipID=" + id;
		}
	}

}

// 转订单收款
function payOrderShip() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要转订单吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var shipid = $("input[name='ShipID']").val();
			var url = "/mmy/enterpayordership?iID=" + id;
			url += "&iShipID=" + shipid;
			window.location = url;
		}
	}

}

// 船票取消订单
function cancelOrderShip() {
	var checkNum = $("input[name='ckone1']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要取消订单吗？")) {
			var id = $("input[name='ckone1']:checked").val();
			var shipid = $("input[name='ShipID']").val();
			var url = "/mmy/entercancelordership?iID=" + id;
			url += "&iShipID=" + shipid;
			window.location = url;
		}
	}

}



//出纳审核
function CashierShip() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());

				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='CashierState']").val();
				list.push(state);
			});

			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckcashiership",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}



//会计对账
function AccountShip() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
				
				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='AccountState']").val();
				list.push(state);
			});
			
			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckaccountship",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}



//结账汇款
function RemittanceShip() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
				
				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='RemittanceState']").val();
				list.push(state);
				
			});
			
			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckremittanceship",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}





// 火车票订单

// 修改火车票预留信息
function updateReserveTrainBase() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var trainid = $("input[name='TrainID']").val();
			var url = "/mmy/enterupdatereservetrain?iID=" + id;
			url += "&iTrainID=" + trainid;
			window.location = url;
		}
	}

}

// 修改火车票订单信息
function updateOrderTrainBase() {
	var checkNum = $("input[name='ckone1']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone1']:checked").val();
			var trainid = $("input[name='TrainID']").val();
			var url = "/mmy/enterupdateordertrain?iID=" + id;
			url += "&iTrainID=" + trainid;
			window.location = url;
		}
	}

}

// 火车票取消预留
function cancelReserveTrain() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要取消预留吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var trainid = $("input[name='TrainID']").val();
			var url = "/mmy/entercancelreservetrain?iID=" + id + "&iTrainID="
					+ trainid;
			// url += "&iScenicID=" + scenicid;
			window.location = url;
		}
	}

}

// 删除取消预留信息
function delReserveTrainBase() {
	var checkNum = $("input[name='ckone3']:checked").length;

	var id = $("input[name='ckone3']:checked").val();
	var trainid = $("input[name='TrainID']").val();

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone3']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$
				.ajax({
					url : "/mmy/delreservetrainbase?iID=" + id + "&iTrainID="
							+ trainid,
					type : "post",
					data : {
						checkList : checklist.toString()
					},
					dataType : "text",
					success : function(data) {
						var url = "/mmy/trainbaseinfo?iTrainID=" + trainid;
						window.location = url;
						alert("删除成功！")

					},
					error : function(msg) {
						alert("删除失败！")
					}
				})
	}

}

// 删除取消订单信息
function delOrderTrainBase() {
	var checkNum = $("input[name='ckone4']:checked").length;

	var id = $("input[name='ckone4']:checked").val();
	var trainid = $("input[name='TrainID']").val();

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone4']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delordertrainbase?iID=" + id + "&iTrainID=" + trainid,
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				var url = "/mmy/trainbaseinfo?iTrainID=" + trainid;
				window.location = url;
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 新建火车票订单预留
function createTrainReserve() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要新建预留么吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterreservetrainbase?iTrainID=" + id;
		}
	}

}

// 转订单收款
function payOrderTrain() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要转订单吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var trainid = $("input[name='TrainID']").val();
			var url = "/mmy/enterpayordertrain?iID=" + id;
			url += "&iTrainID=" + trainid;
			window.location = url;
		}
	}

}

// 火车票取消订单
function cancelOrderTrain() {
	var checkNum = $("input[name='ckone1']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要取消订单吗？")) {
			var id = $("input[name='ckone1']:checked").val();
			var trainid = $("input[name='TrainID']").val();
			var url = "/mmy/entercancelordertrain?iID=" + id;
			url += "&iTrainID=" + trainid;
			window.location = url;
		}
	}

}


//出纳审核
function CashierTrain() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());

				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='CashierState']").val();
				list.push(state);
			});

			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckcashiertrain",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}



//会计对账
function AccountTrain() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
				
				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='AccountState']").val();
				list.push(state);
			});
			
			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckaccounttrain",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}



//结账汇款
function RemittanceTrain() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
				
				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='RemittanceState']").val();
				list.push(state);
				
			});
			
			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckremittancetrain",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}







// 签证

// 修改签证预留信息
function updateReserveVisa() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var visaid = $("input[name='VisaID']").val();
			var url = "/mmy/enterupdatereservevisa?iID=" + id;
			url += "&iVisaID=" + visaid;
			window.location = url;
		}
	}

}

// 修改签证订单信息
function updateOrderVisa() {
	var checkNum = $("input[name='ckone1']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone1']:checked").val();
			var visaid = $("input[name='VisaID']").val();
			var url = "/mmy/enterupdateordervisa?iID=" + id;
			url += "&iVisaID=" + visaid;
			window.location = url;
		}
	}

}

// 签证取消预留
function cancelReserveVisa() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要取消预留吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var visaid = $("input[name='VisaID']").val();
			var url = "/mmy/entercancelreservevisa?iID=" + id + "&iVisaID="
					+ visaid;
			// url += "&iScenicID=" + scenicid;
			window.location = url;
		}
	}

}

// 删除取消预留信息
function delReserveVisa() {
	var checkNum = $("input[name='ckone3']:checked").length;

	var id = $("input[name='ckone3']:checked").val();
	var visaid = $("input[name='VisaID']").val();

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone3']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delreservevisaindex?iID=" + id + "&iVisaID=" + visaid,
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				var url = "/mmy/visainfo?iVisaID=" + visaid;
				window.location = url;
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除取消订单信息
function delOrderVisa() {
	var checkNum = $("input[name='ckone4']:checked").length;

	var id = $("input[name='ckone4']:checked").val();
	var visaid = $("input[name='VisaID']").val();

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone4']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delordervisaindex?iID=" + id + "&iVisaID=" + visaid,
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				var url = "/mmy/visainfo?iVisaID=" + visaid;
				window.location = url;
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 新建签证订单预留
function createVisaReserve() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要新建预留么吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterreservevisaindex?iVisaID=" + id;
		}
	}
}
// 前台新建签证订单预留
function visaReserve(state) {
	if (confirm("确定要新建预留吗？")) {
		var id = $("#Surrouding"+state).val();
		location.href = "/mmy/reservevisa?iVisaID=" + id;
	}
}
// 转订单收款
function payOrderVisa() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要转订单吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var visaid = $("input[name='VisaID']").val();
			var url = "/mmy/enterpayordervisa?iID=" + id;
			url += "&iVisaID=" + visaid;
			window.location = url;
		}
	}

}

// 签证取消订单
function cancelOrderVisa() {
	var checkNum = $("input[name='ckone1']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要取消订单吗？")) {
			var id = $("input[name='ckone1']:checked").val();
			var visaid = $("input[name='VisaID']").val();
			var url = "/mmy/entercancelordervisa?iID=" + id;
			url += "&iVisaID=" + visaid;
			window.location = url;
		}
	}

}


//出纳审核
function CashierVisa() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());

				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='CashierState']").val();
				list.push(state);
			});

			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckcashiervisa",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}



//会计对账
function AccountVisa() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
				
				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='AccountState']").val();
				list.push(state);
			});
			
			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckaccountvisa",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}



//结账汇款
function RemittanceVisa() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
				
				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='RemittanceState']").val();
				list.push(state);
				
			});
			
			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckremittancevisa",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}






// 餐馆订单

// 修改餐馆预留信息
function updateReserveRestaurant() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var restaurantid = $("input[name='RestaurantID']").val();
			var url = "/mmy/enterupdatereserverestaurant?iID=" + id;
			url += "&iRestaurantID=" + restaurantid;
			window.location = url;
		}
	}

}

// 修改餐馆订单信息
function updateOrderRestaurant() {
	var checkNum = $("input[name='ckone1']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone1']:checked").val();
			var restaurantid = $("input[name='RestaurantID']").val();
			var url = "/mmy/enterupdateorderrestaurant?iID=" + id;
			url += "&iRestaurantID=" + restaurantid;
			window.location = url;
		}
	}

}

// 餐馆取消预留
function cancelReserveRestaurant() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要取消预留吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var restaurantid = $("input[name='RestaurantID']").val();
			var url = "/mmy/entercancelreserverestaurant?iID=" + id
					+ "&iRestaurantID=" + restaurantid;
			// url += "&iScenicID=" + scenicid;
			window.location = url;
		}
	}

}

// 删除取消预留信息
function delReserveRestaurant() {
	var checkNum = $("input[name='ckone3']:checked").length;

	var id = $("input[name='ckone3']:checked").val();
	var restaurantid = $("input[name='RestaurantID']").val();

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone3']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delreserverestaurant?iID=" + id + "&iRestaurantID="
					+ restaurantid,
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				var url = "/mmy/restaurantinfo?iRestaurantID=" + restaurantid;
				window.location = url;
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除取消订单信息
function delOrderRestaurant() {
	var checkNum = $("input[name='ckone4']:checked").length;

	var id = $("input[name='ckone4']:checked").val();
	var restaurantid = $("input[name='RestaurantID']").val();

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone4']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delorderrestaurant?iID=" + id + "&iRestaurantID="
					+ restaurantid,
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				var url = "/mmy/restaurantinfo?iRestaurantID=" + restaurantid;
				window.location = url;
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 新建餐馆订单预留
function createRestaurantReserve() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要新建预留么吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterreserverestaurant?iRestaurantID=" + id;
		}
	}

}
// 转订单收款
function payOrderRestaurant() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要转订单吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var restaurantid = $("input[name='RestaurantID']").val();
			var url = "/mmy/enterpayorderrestaurant?iID=" + id;
			url += "&iRestaurantID=" + restaurantid;
			window.location = url;
		}
	}

}

// 餐馆取消订单
function cancelOrderRestaurant() {
	var checkNum = $("input[name='ckone1']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要取消订单吗？")) {
			var id = $("input[name='ckone1']:checked").val();
			var restaurantid = $("input[name='RestaurantID']").val();
			var url = "/mmy/entercancelorderrestaurant?iID=" + id;
			url += "&iRestaurantID=" + restaurantid;
			window.location = url;
		}
	}

}



//出纳审核
function CashierRestaurant() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());

				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='CashierState']").val();
				list.push(state);
			});

			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckcashierrestaurant",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}



//会计对账
function AccountRestaurant() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
				
				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='AccountState']").val();
				list.push(state);
			});
			
			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckaccountrestaurant",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}



//结账汇款
function RemittanceRestaurant() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
				
				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='RemittanceState']").val();
				list.push(state);
				
			});
			
			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckremittancerestaurant",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}





// 线路订单

// 修改线路预留信息
function updateReserveLine() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var lineID = $("input[name='ckone']:checked").parents("tr").find("input[type='hidden']").val();
			var id = $("input[name='ckone']:checked").val();
			var url = "/mmy/toupdatereserveline?iID=" + id;
			url += "&iLineID=" + lineID;
			window.location = url;
		}
	}

}

// 修改线路订单信息
function updateOrderLine() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var lineID = $("input[name='ckone']:checked").parents("tr").find("input[type='hidden']").val();
			var id = $("input[name='ckone']:checked").val();
			var url = "/mmy/toupdateorderline?iID=" + id;
			url += "&iLineID=" + lineID;
			window.location = url;
		}
	}

}

// 线路取消预留 liys 2020.12.28
function cancelReserveLine() {
	var checkNum = $("input[name='ckone']:checked").length;
	if (checkNum == 0) {
		var txt = "至少选择一项";
		window.wxc.xcConfirm(txt,window.wxc.xcConfirm.typeEnum.error);
		return;
	} else if (checkNum > 1) {
		var txt = "最多选择一项";
		window.wxc.xcConfirm(txt,window.wxc.xcConfirm.typeEnum.error);
		return;
	} else {
		var txt = "确定要取消预留吗？";
		window.wxc.xcConfirm(txt,window.wxc.xcConfirm.typeEnum.confirm,{onOk:function(){
		var lineID = $("input[name='ckone']:checked").parents("tr").find("input[type='hidden']").val();
		var id = $("input[name='ckone']:checked").val();
		var url = "/mmy/tocancelreserveline?iID=" + id;
		url += "&iLineID=" + lineID;
		window.location = url;
		}});
	}
}
// 线路取消预留 liys 2020.12.28
function cancelReserveLineUnion() {
	var checkNum = $("input[name='ckone']:checked").length;
	if (checkNum == 0) {
		var txt = "至少选择一项";
		window.wxc.xcConfirm(txt,window.wxc.xcConfirm.typeEnum.error);
		return;
	} else if (checkNum > 1) {
		var txt = "最多选择一项";
		window.wxc.xcConfirm(txt,window.wxc.xcConfirm.typeEnum.error);
		return;
	} else if(checkNum == 1) {
		var operatorOrgID = $("input[name='ckone']:checked").parents("tr").find("input[name='operatorOrgID']").val();
		var logUserOrgID = $("#logUserOrgID").val();
		var lineID = $("input[name='ckone']:checked").parents("tr").find("input[name='LineID']").val();
		if(operatorOrgID != logUserOrgID){
			var txt = "外来采购单，不能操作！";
			window.wxc.xcConfirm(txt,window.wxc.xcConfirm.typeEnum.error);
			return;
		}else if( operatorOrgID == logUserOrgID){
			var txt = "确定要取消预留吗？";
			window.wxc.xcConfirm(txt,window.wxc.xcConfirm.typeEnum.confirm,{onOk:function(){
			var id = $("input[name='ckone']:checked").val();
			var url = "/mmy/tocancelreserveline?iID=" + id;
			url += "&iLineID=" + lineID;
			window.location = url;
			}});
		}
		
	}
}
// 线路订单打印凭证 liys 2020.12.28
function toprintline() {
	var checkNum = $("input[name='ckone']:checked").length;
	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		var lineID = $("input[name='ckone']:checked").parents("tr").find("input[type='hidden']").val();
		var id = $("input[name='ckone']:checked").val();
		var url = "/mmy/printline?iID=" + id;
		url += "&iLineID=" + lineID;
		window.location = url;
		
	}
}
// 线路订单打印凭证 liys 2020.12.28
function toprintlineUnion() {
	var checkNum = $("input[name='ckone']:checked").length;
	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		var orderUserOrgID = $("input[name='ckone']:checked").parents("tr").find("input[name='orderUserOrgID']").val();
		var logUserOrgID = $("#logUserOrgID").val();
		if(orderUserOrgID != logUserOrgID){
			var txt = "外来采购单，不能打印！";
			window.wxc.xcConfirm(txt,window.wxc.xcConfirm.typeEnum.error);
			return;
		}else{
			var lineID = $("input[name='ckone']:checked").parents("tr").find("input[name='LineID']").val();
			var id = $("input[name='ckone']:checked").val();
			var url = "/mmy/printline?iID=" + id;
			url += "&iLineID=" + lineID;
			window.location = url;
		}
	}
}
// 删除取消预留信息
function delReserveLine() {
	var checkNum = $("input[name='ckone3']:checked").length;

	var id = $("input[name='ckone3']:checked").val();
	var lineid = $("input[name='LineID']").val();

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone3']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delreserveline?iID=" + id + "&iLineID=" + lineid,
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				var url = "/mmy/linebaseinfo?LineID=" + lineid;
				window.location = url;
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除取消订单信息
function delOrderLine() {
	var checkNum = $("input[name='ckone4']:checked").length;

	var id = $("input[name='ckone4']:checked").val();
	var lineid = $("input[name='LineID']").val();

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone4']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delorderline?iID=" + id + "&iLineID=" + lineid,
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				var url = "/mmy/linebaseinfo?LineID=" + lineid;
				window.location = url;
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 新建线路订单预留
function createLineReserve(state) { 
	
	var id = $("#Surrouding"+state).val();
	location.href = "/mmy/toreserveline?iLineID=" + id;
}
// 新建线路订单预留(在前台线路详情页预留) liys 2021.1.7
function createLineReserveInfo() { 
	
	var id = $("#lineID").val();
	location.href = "/mmy/toreserveline?iLineID=" + id;

}
// 转订单收款
function payOrderLine() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		var txt = "至少选择一项";
		window.wxc.xcConfirm(txt,window.wxc.xcConfirm.typeEnum.info);
		return;
	} else if (checkNum > 1) {
		var txt = "最多选择一项";
		window.wxc.xcConfirm(txt,window.wxc.xcConfirm.typeEnum.info);
		return;
	} else {
		var txt = "确定要转订单吗？";
		window.wxc.xcConfirm(txt,window.wxc.xcConfirm.typeEnum.confirm,{onOk:function(){
			var lineID = $("input[name='ckone']:checked").parents("tr").find("input[type='hidden']").val();
			var id = $("input[name='ckone']:checked").val();
			var url = "/mmy/topayorderline?iID=" + id;
			url += "&iLineID=" + lineID;
			window.location = url;
		}});
	}
}
// 转订单收款
function payOrderLineUnion() {
	var checkNum = $("input[name='ckone']:checked").length;
	if (checkNum == 0) {
		var txt = "至少选择一项";
		window.wxc.xcConfirm(txt,window.wxc.xcConfirm.typeEnum.info);
		return;
	} else if (checkNum > 1) {
		var txt = "最多选择一项";
		window.wxc.xcConfirm(txt,window.wxc.xcConfirm.typeEnum.info);
		return;
	} else {
		var lineID = $("input[name='ckone']:checked").parents("tr").find("input[type='hidden']").val();
		var operatorOrgID = $("input[name='ckone']:checked").parents("tr").find("input[name='operatorOrgID']").val();
		var logUserOrgID = $("#logUserOrgID").val();
		if(operatorOrgID != logUserOrgID){
			var txt = "外来采购单，不能收款！";
			window.wxc.xcConfirm(txt,window.wxc.xcConfirm.typeEnum.error);
			return;
		}else if(operatorOrgID == logUserOrgID){
			var txt = "确定要转订单吗？";
			window.wxc.xcConfirm(txt,window.wxc.xcConfirm.typeEnum.confirm,{onOk:function(){
			var id = $("input[name='ckone']:checked").val();
			var url = "/mmy/topayorderline?iID=" + id;
			url += "&iLineID=" + lineID;
			window.location = url;
			}});
		}
	}
}
// 采购方线路退单申请 liys
function cancelOrderLine() {
	var checkNum = $("input[name='ckone']:checked").length;
	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要申请退单吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var url = "/mmy/tocancelorderline?iID=" + id;
			window.location = url;
		}
	}
}
// 线路退单申请(合集版)  liys 2021.01.25 
function cancelOrderLineUnion() {
	var checkNum = $("input[name='ckone']:checked").length;
	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		var orderUserOrgID = $("input[name='ckone']:checked").parents("tr").find("input[name='orderUserOrgID']").val();
		var refundProcess = $("input[name='ckone']:checked").parents("tr").find("input[name='refundProcess']").val();
		var logUserOrgID = $("#logUserOrgID").val();
		if(orderUserOrgID != logUserOrgID){
			var txt = "外来采购订单，没有权限退单！";
			window.wxc.xcConfirm(txt,window.wxc.xcConfirm.typeEnum.error);
			return;
		}else if(refundProcess !=0){
			var txt = "此订单已在退款流程中，请到退单选项查看！";
			window.wxc.xcConfirm(txt,window.wxc.xcConfirm.typeEnum.error);
			return;
		}else{
			var txt = "确定要退单吗？";
			window.wxc.xcConfirm(txt,window.wxc.xcConfirm.typeEnum.confirm,{onOk:function(){
			var id = $("input[name='ckone']:checked").val();
			var lineID = $("input[name='ckone']:checked").parents("tr").find("input[name='LineID']").val();
			var url = "/mmy/tocancelorderlineunion?iID=" + id;
			url += "&iLineID=" + lineID;
			window.location = url;
			}});
		}
	}
}
//退单申请 liys 2020.12.29
function OrderCancelApply(){
	var checkNum = $("input[name='ckone']:checked").length;
	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要取消订单吗？")) {
			var lineID = $("input[name='ckone']:checked").parents("tr").find("input[type='hidden']").val();
			var id = $("input[name='ckone']:checked").val();
			var url = "/mmy/OrderCancelApply?iID=" + id;
			url += "&iLineID=" + lineID;
			window.location = url;
		}
	}
}
//进口订单退款 liys 2020.12.29
function ImpRefund(){
	var checkNum = $("input[name='ckone']:checked").length;
	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		var state = $("input[name='ckone']:checked").parents("tr").find("input[name='orderState']").val();
		if(state == 4){
			alert("此订单已经退款！");
			return;
		}
		else if (confirm("确定要退款吗？")) {
			var lineID = $("input[name='ckone']:checked").parents("tr").find("input[type='hidden']").val();
			var id = $("input[name='ckone']:checked").val();
			var url = "/mmy/refund?iID=" + id;
			url += "&iLineID=" + lineID;
			window.location = url;
		}
	}
}
//本公司退款 liys 2021.01.19
function Refund(){
	var checkNum = $("input[name='ckone']:checked").length;
	if (checkNum == 0) {
		var txt = "至少选择一项";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
		return;
	} else if (checkNum > 1) {
		var txt = "最多选择一项";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
		return;
	} else {
		var txt = "确定要退款吗？";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.confirm,{onOk:function(){
		var lineID = $("input[name='ckone']:checked").parents("tr").find("input[type='hidden']").val();
		var id = $("input[name='ckone']:checked").val();
		var url = "/mmy/refund?iID=" + id;
		url += "&iLineID=" + lineID;
		window.location = url;
		}});
	}
}

//退单申请 liys 2021.01.18
function cancelOrderLineImp(){
	var checkNum = $("input[name='ckone']:checked").length;
	if(checkNum == 0){
		var txt = "至少选择一项";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
		return;
	}else if(checkNum > 1){
		var txt = "最多选择一项";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
		return;
	}else{
		var process = $("input[name='ckone']:checked").parents("tr").find("input[name='refundProcess']").val();
		if(!process == 0){
			var txt = "此订单已在退款状态中";
			window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
			return;
		}else{
			var txt = "确定要申请退款吗？"
			window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.success,{onOk:function(){
				var id = $("input[name='ckone']:checked").val();
				var url = "/mmy/applyrefund?iID=" + id;
				window.location = url;
			}});
		}
	}
}

//允许退单 liys 2021.01.18
function cancelAllow(){
	var checkNum = $("input[name='ckone']:checked").length;
	if(checkNum == 0){
		var txt = "至少选择一项";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
		return;
	}else if(checkNum > 1){
		var txt = "最多选择一项";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
		return;
	}else{
		window.wxc.xcConfirm("请输入退单金额", "input",{onOk:function(){
			var ref = $(".inputBox").val();
			var id = $("input[name='ckone']:checked").val();
			var url = "/mmy/cancelAllow?iID=" + id;
			url += "&ref=" + ref;
			window.location = url;
		}});
	}
}

//不允许退单 liys 2021.01.18
function cancelDisAllow(){
	var checkNum = $("input[name='ckone']:checked").length;
	if(checkNum == 0){
		var txt = "至少选择一项";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
		return;
	}else if(checkNum > 1){
		var txt = "至少选择一项";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
		return;
	}else{
		var txt = "确定不允许退款吗？";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.confirm,{onOk:function(){
			var id = $("input[name='ckone']:checked").val();
			var url = "/mmy/cancelDisAllow?iID="+id;
			window.location = url;
		}});		
	}
}
//退款打印(退单表格页) liys 2020.12.29
function printCancelLine(){
	var checkNum = $("input[name='ckone']:checked").length;
	if (checkNum == 0) {
		var txt = "至少选择一项";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
		return;
	} else if (checkNum > 1) {
		var txt = "最多选择一项";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
		return;
	} else {	
		var refundProcess = $("input[name='ckone']:checked").parents("tr").find("#refundProcess").val();
		if(refundProcess==0){
			var txt = "此订单存在问题，请联系管理小姐姐！";
			window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
			return;
		}else if(refundProcess==1){
			var txt = "此退单仍在审核中，不能打印凭证！";
			window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
			return;
		}else if(refundProcess==3){
			var txt = "此订单已取消退单，不能打印凭证！";
			window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
			return;
		}else if(refundProcess==2){
			var lineID = $("input[name='ckone']:checked").parents("tr").find("input[type='hidden']").val();
			var id = $("input[name='ckone']:checked").val();
			var url = "/mmy/printcancelline?iID=" + id;
			url += "&iLineID=" + lineID;
			window.location = url;
		}	
	}
}
//取消退单
function CancelRefund(){
	var checkNum = $("input[name='ckone']:checked").length;
	if (checkNum == 0) {
		var txt = "至少选择一项";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
		return;
	} else if (checkNum > 1) {
		var txt = "最多选择一项";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
		return;
	} else {	
		var refundProcess = $("input[name='ckone']:checked").parents("tr").find("#refundProcess").val();
		if(refundProcess==0){
			var txt = "此订单存在问题，请联系客服小姐姐！";
			window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
			return;
		}else if(refundProcess==2){
			var txt = "退款已经允许，不能取消！";
			window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
			return;
		}else if(refundProcess==3){
			var txt = "此订单已取消退单，无需再次操作！";
			window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
			return;
		}else if(refundProcess==1){
			var txt = "确认取消退单吗？";
			window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.confirm,{onOk:function(){
				var id = $("input[name='ckone']:checked").val();
				var url = "/mmy/cancelrefund?iID=" + id;
				window.location = url;
			}});
		}	
	}
}
/*退单汇总页 liys 2021.01.26*/
//取消退单 OrgID = OrgID refundpro = 1
function lineCancelRefundUnion(){
	var checkNum = $("input[name='ckone']:checked").length;
	if (checkNum == 0) {
		var txt = "至少选择一项";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
		return;
	} else if (checkNum > 1) {
		var txt = "最多选择一项";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
		return;
	} else {
		var orderUserOrgID = $("input[name='ckone']:checked").parents("tr").find("input[name='orderUserOrgID']").val();
		var refundProcess = $("input[name='ckone']:checked").parents("tr").find("input[name='refundProcess']").val();
		var logUserOrgID = $("#logUserOrgID").val();
		if(orderUserOrgID != logUserOrgID || refundProcess != 1){
			var txt = "此订单不能取消退单";
			window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
			return;
		}else if(orderUserOrgID == logUserOrgID & refundProcess == 1){
			var txt = "确定要取消退单吗？";
			window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.confirm,{onOk:function(){
				var id = $("input[name='ckone']:checked").val();
				var url = "/mmy/cancelrefund?iID=" + id;
				window.location = url;
			}});	
		}
	}
}
//回复申请 org !=org refundpro = 1
function replyOrderCancel(){
	var checkNum = $("input[name='ckone']:checked").length;
	if (checkNum == 0) {
		var txt = "至少选择一项";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
		return;
	} else if (checkNum > 1) {
		var txt = "最多选择一项";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
		return;
	} else {
		var orderUserOrgID = $("input[name='ckone']:checked").parents("tr").find("input[name='orderUserOrgID']").val();
		var refundProcess = $("input[name='ckone']:checked").parents("tr").find("input[name='refundProcess']").val();
		var logUserOrgID = $("#logUserOrgID").val();
		if(orderUserOrgID == logUserOrgID || refundProcess != 1){
			var txt = "该订单不能回复申请！";
			window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
			return;
		}else if(orderUserOrgID != logUserOrgID & refundProcess == 1){
			layer.confirm('允许退单吗？', {
			btn: ['允许', '拒绝']
			}, function() {
				layer.prompt({
				title: '请输入退款金额',
				formType: 1
				}, function(text, index) {
					layer.close(index);
					layer.msg('退款金额' + text);
					var id = $("input[name='ckone']:checked").val();
					var url = "/mmy/cancelAllow?iID=" + id;
					url += "&ref=" + text;
					window.location = url;
				})
				}, function() {
					layer.msg('已拒绝退款');
					var id = $("input[name='ckone']:checked").val();
					var url = "/mmy/cancelDisAllow?iID="+id;
					window.location = url;
			});
		}
	}
}
//打印凭证 org = org state=4
function printCancelLineUnion(){
	var checkNum = $("input[name='ckone']:checked").length;
	if (checkNum == 0) {
		var txt = "至少选择一项";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
		return;
	} else if (checkNum > 1) {
		var txt = "最多选择一项";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
		return;
	} else {
		var orderUserOrgID = $("input[name='ckone']:checked").parents("tr").find("input[name='orderUserOrgID']").val();
		var orderState = $("input[name='ckone']:checked").parents("tr").find("input[name='orderState']").val();
		var logUserOrgID = $("#logUserOrgID").val();
		if(orderUserOrgID != logUserOrgID || orderState != 4){
			var txt = "此订单状态不能打印凭证！";
			window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
			return;
		}else if(orderUserOrgID == logUserOrgID & orderState == 4){
			var lineID = $("input[name='ckone']:checked").parents("tr").find("input[name='LineID']").val();
			var id = $("input[name='ckone']:checked").val();
			var url = "/mmy/printcancelline?iID=" + id;
			url += "&iLineID=" + lineID;
			window.location = url;
		}
	}
	
	
}
//退款	org = org refundpro = 2 state!=4
function RefundUnion(){
	var checkNum = $("input[name='ckone']:checked").length;
	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		var orderUserOrgID = $("input[name='ckone']:checked").parents("tr").find("input[name='orderUserOrgID']").val();
		var orderState = $("input[name='ckone']:checked").parents("tr").find("input[name='orderState']").val();
		var refundProcess = $("input[name='ckone']:checked").parents("tr").find("input[name='refundProcess']").val();
		var logUserOrgID = $("#logUserOrgID").val();
		console.log("1:" + orderUserOrgID +";2:"+ orderState +";3:"+ refundProcess +";4:"+ logUserOrgID);
		if(orderUserOrgID != logUserOrgID || refundProcess != 2 || orderState == 4){
			var txt = "此订单不能退款";
			window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
			return;
		}else if(orderUserOrgID == logUserOrgID & refundProcess == 2 & orderState != 4){
			var txt = "确定要退款吗？";
			window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.confirm,{onOk:function(){
				var id = $("input[name='ckone']:checked").val();
				var url = "/mmy/refund?iID=" + id;
				window.location = url;
			}});		
		}
	}
}




//会计对账
function AccountLine() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
				
				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='AccountState']").val();
				list.push(state);
			});
			
			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/tocheckaccountline",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}



//结账汇款
function RemittanceLine() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
				
				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='RemittanceState']").val();
				list.push(state);
				
			});
			
			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/tocheckremittanceline",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}




// 酒店订单

// 修改线路预留信息
function updateReserveHotel() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var roomid = $("input[name='RoomID']").val();
			var url = "/mmy/enterupdatereservehotel?iID=" + id;
			url += "&iRoomID=" + roomid;
			window.location = url;
		}
	}

}

// 修改酒店订单信息
function updateOrderHotel() {
	var checkNum = $("input[name='ckone1']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要修改吗？")) {
			var id = $("input[name='ckone1']:checked").val();
			var roomid = $("input[name='RoomID']").val();
			var url = "/mmy/enterupdateorderhotel?iID=" + id;
			url += "&iRoomID=" + roomid;
			window.location = url;
		}
	}

}

// 酒店取消预留
function cancelReserveHotel() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要取消预留吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var roomid = $("input[name='RoomID']").val();
			var url = "/mmy/entercancelreservehotel?iID=" + id + "&iRoomID="
					+ roomid;
			// url += "&iScenicID=" + scenicid;
			window.location = url;
		}
	}

}

// 删除取消预留信息
function delReserveHotel() {
	var checkNum = $("input[name='ckone3']:checked").length;

	var id = $("input[name='ckone3']:checked").val();
	var roomid = $("input[name='RoomID']").val();

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone3']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delreservehotel?iID=" + id + "&iRoomID=" + roomid,
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				var url = "/mmy/hotelorder?iRoomID=" + roomid;
				window.location = url;
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 删除取消订单信息
function delOrderHotel() {
	var checkNum = $("input[name='ckone4']:checked").length;

	var id = $("input[name='ckone4']:checked").val();
	var roomid = $("input[name='RoomID']").val();

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要删除吗？")) {
			var checklist = new Array();
			$("input[name='ckone4']:checked").each(function() {
				checklist.push($(this).val());
			});
		}

		$.ajax({
			url : "/mmy/delorderhotel?iID=" + id + "&iRoomID=" + roomid,
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				var url = "/mmy/hotelorder?iRoomID=" + roomid;
				window.location = url;
				alert("删除成功！")

			},
			error : function(msg) {
				alert("删除失败！")
			}
		})
	}

}

// 新建电子票预留
function createHotelReserve() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要新建预留么吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/enterreservehotel?iRoomID=" + id;
		}
	}

}

// 转订单收款
function payOrderHotel() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要转订单吗？")) {
			var id = $("input[name='ckone']:checked").val();
			var roomid = $("input[name='RoomID']").val();
			var url = "/mmy/enterpayorderhotel?iID=" + id;
			url += "&iRoomID=" + roomid;
			window.location = url;
		}
	}

}

// 酒店取消订单
function cancelOrderHotel() {
	var checkNum = $("input[name='ckone1']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要取消订单吗？")) {
			var id = $("input[name='ckone1']:checked").val();
			var roomid = $("input[name='RoomID']").val();
			var url = "/mmy/entercancelorderhotel?iID=" + id;
			url += "&iRoomID=" + roomid;
			window.location = url;
		}
	}

}



//出纳审核
function CashierHotel() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());

				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='CashierState']").val();
				list.push(state);
			});

			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckcashierhotel",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}



//会计对账
function AccountHotel() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
				
				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='AccountState']").val();
				list.push(state);
			});
			
			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckaccounthotel",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}



//结账汇款
function RemittanceHotel() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {

		if (confirm("确定要审核吗？")) {
			var checklist = new Array();
			var list = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());
				
				// 获得所选行tr信息
				var row = $(this).parent("td").parent("tr");
				// 获得状态值
				var state = row.find("[name='RemittanceState']").val();
				list.push(state);
				
			});
			
			var a = list[0];
			for (var i = 0; i < list.length; i++) {
				if (list[i] != a) {
					alert("审核状态不同");
					return;
				}
			}
		}
		$.ajax({
			url : "/mmy/entercheckremittancehotel",
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				location.reload();

			},
			error : function(msg) {
				alert("失败！")
			}
		})
	}

}






// 审核物料出库
function checkUpdateMaterialOut() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要审核吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/entercheckupdatematerialout?iOutID=" + id;
		}
	}

}

// 审核激励记录
function checkUpdateRewardInfo() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要审核吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/entercheckupdaterewardinfo?iRewardID=" + id;
		}
	}

}

// 审核请假记录
function checkUpdateLeaveInfo() {
	var checkNum = $("input[name='ckone']:checked").length;

	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else if (checkNum > 1) {
		alert("最多选择一项");
		return;
	} else {
		if (confirm("确定要审核吗？")) {
			var id = $("input[name='ckone']:checked").val();
			location.href = "/mmy/entercheckupdateleaveinfo?iLeaveID=" + id;
		}
	}

}
// 通过请假审核
function passLeaveInfo() {
	$.ajax({
		url : "/mmy/checkupdateleaveinfo?iFlag=" + 3,
		type : "post",
		data : $('#form1').serialize(),
		dataType : "text",
		success : function(data) {
			location.href = "leaveinfo";
		},
		error : function(XMLHttpRequest, textStatus, errorThrown) {
			alert(XMLHttpRequest.status);
			// alert(XMLHttpRequest.readyState);
			// alert(textStatus);
		}
	})

}
// 拒绝请假审核
function refuseLeaveInfo() {
	$.ajax({
		url : "/mmy/checkupdateleaveinfo?iFlag=" + 1,
		type : "post",
		data : $('#form1').serialize(),
		dataType : "text",
		success : function(data) {

			location.href = "leaveinfo";
		},
		error : function(XMLHttpRequest, textStatus, errorThrown) {
			alert(XMLHttpRequest.status);
			// alert(XMLHttpRequest.readyState);
			// alert(textStatus);
		}
	})

}

// 保存修改权限菜单
function saveUpdatePermissionMenu() {
	var checkNum = $("input[name='ckone']:checked").length;
	if (checkNum == 0) {
		alert("至少选择一项");
		return;
	} else {
		var id = $("input[name='RoleName']").val();
		var checklist = new Array();
		$("input[name='ckone']:checked").each(function() {
			checklist.push($(this).val());
		});

		$.ajax({
			url : "/mmy/updatepermissionmenu?iRoleID=" + id,
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function(data) {
				
				location.href = "permission";
				alert("编辑成功");
			},
			error : function(XMLHttpRequest, textStatus, errorThrown) {
				alert(XMLHttpRequest.status);
//				alert(XMLHttpRequest.readyState);
//				alert(textStatus);
			}
		})
	}

}

// 菜单级联

function upMenuIDChange(value) {
	if (value == 0) {
		$("#Type option[value='0']").hide();
		$("#Type option[value='2']").hide();
		$("#Type option[value='1']").show();

		
		$("#State option[value='1']").show();
		$("#State option[value='2']").show();
		$("#State option[value='3']").show();
		$("#State").removeAttr("disabled");
		$("#Type").val("1");
	} else {
		$("#Type option[value='0']").show();
		$("#Type option[value='2']").show();
		$("#Type option[value='1']").hide();

		
		$("#State option[value='1']").hide();
		$("#State option[value='2']").hide();
		$("#State option[value='3']").hide();
		$("#State").attr("disabled","disabled");
		$("#Type").val("请选择");
	}

}


/* 签证材料整理 */
function updateVisaCollection() {
	var checkNum = $("input[name='ckone1']:checked").length;

	if (checkNum == 0) {
		var txt = "至少选择一项";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.warning);

	} else if (checkNum > 1) {
		var txt = "最多选择一项";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.warning);
	} else {
		var iID = $("input[name='ckone1']:checked").val();
		var iVisaID = $("input[name='VisaID']").val();

		var url = "/mmy/toupdatevisacollection?iID=" + iID;
		url += "&iVisaID=" + iVisaID;
		window.location = url;

	}

}

function updateSubmit() {
	var checkNum = $("input[name='ckone']:checked").length;
	var iID = $("input[name='ID']").val();
	var iVisaID = $("input[name='VisaID']").val();
	if (checkNum == 0) {
		var txt = "至少选择一项";
		window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.warning);
	} else {

		if (confirm("确定要提交吗？")) {
			var checklist = new Array();
			$("input[name='ckone']:checked").each(function() {
				checklist.push($(this).val());

			});
		}

		$.ajax({
			url : "/mmy/toupdatesubmit?iID=" + iID + "&iVisaID=" + iVisaID,
			type : "post",
			data : {
				checkList : checklist.toString()
			},
			dataType : "text",
			success : function() {
				location.reload();
				var txt = "提交成功";
				window.wxc
						.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.success);

			},
			error : function() {
				var txt = "提交失败";
				window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
			}
		})
	}
}

/* 编写类型价值度等四级联动 */

function changeSelect(_this, url, level, clazz) {
	/* 获取当前select的value值 */
	var level1 = $(_this).val();
	if(level1==""){
		return false;
	}
	// console.log(level1);
	/* ajax请求的参数，根据level的值返回相应的json数据 */
	var paraStr = level + "=" + level1;
	/* 通过当前的位置确定整行tr的域，后面的操作都会限定在这个tr域中进行 */
	var trObj = $(_this).parent().parent();
	$.ajax({
		url : '' + url + "?" + paraStr,
		type : 'post',
		data : {},
		dataType : 'json',
		success : function(result) {
			// console.log("url====>"+this.url);
			// console.log("result====>"+result);
			var optionStr = "<option value=''>---请选择---</option>";
			/* 对返回的结果进行遍历 */
			$.each(result, function(index, element) {
				optionStr += "<option value='" + element.zoneID + "'>"
						+ element.zoneName + "</option>";
			});
			// $("."+clazz,trObj).empty();
			/* 防止每次拼接之后的无限追加 */
			trObj.find("." + clazz).empty();
			trObj.find("." + clazz).append(optionStr);
		}
	});
}

function changeSelect1(_this, url, level, clazz) {
	/* 获取当前select的value值 */
	var level1 = $(_this).val();
	// console.log(level1);
	/* ajax请求的参数，根据level的值返回相应的json数据 */
	var paraStr = level + "=" + level1;
	/* 通过当前的位置确定整行tr的域，后面的操作都会限定在这个tr域中进行 */
	var trObj = $(_this).parent().parent();
	$.ajax({
		url : '' + url + "?" + paraStr,
		type : 'post',
		data : {},
		dataType : 'json',
		success : function(result) {
			// console.log("url====>"+this.url);
			// console.log("result====>"+result);
			var optionStr = "<option value=''>---请选择---</option>";
			/* 对返回的结果进行遍历 */
			$.each(result, function(index, element) {
				optionStr += "<option value='" + element.airportID + "'>"
						+ element.airportName + "</option>";
			});
			// $("."+clazz,trObj).empty();
			/* 防止每次拼接之后的无限追加 */
			trObj.find("." + clazz).empty();
			trObj.find("." + clazz).append(optionStr);
		}
	});
}

function changeSelect2(_this, url, level, clazz) {
	/* 获取当前select的value值 */
	var level1 = $(_this).val();
	// console.log(level1);
	/* ajax请求的参数，根据level的值返回相应的json数据 */
	var paraStr = level + "=" + level1;
	/* 通过当前的位置确定整行tr的域，后面的操作都会限定在这个tr域中进行 */
	var trObj = $(_this).parent().parent();
	$.ajax({
		url : '' + url + "?" + paraStr,
		type : 'post',
		data : {},
		dataType : 'json',
		success : function(result) {
			// console.log("url====>"+this.url);
			// console.log("result====>"+result);
			var optionStr = "<option value=''>---请选择---</option>";
			/* 对返回的结果进行遍历 */
			$.each(result, function(index, element) {
				optionStr += "<option value='" + element.portID + "'>"
						+ element.portName + "</option>";
			});
			// $("."+clazz,trObj).empty();
			/* 防止每次拼接之后的无限追加 */
			trObj.find("." + clazz).empty();
			trObj.find("." + clazz).append(optionStr);
		}
	});
}

function changeSelect3(_this, url, level, clazz) {
	/* 获取当前select的value值 */
	var level1 = $(_this).val();
	// console.log(level1);
	/* ajax请求的参数，根据level的值返回相应的json数据 */
	var paraStr = level + "=" + level1;
	/* 通过当前的位置确定整行tr的域，后面的操作都会限定在这个tr域中进行 */
	var trObj = $(_this).parent().parent();
	$.ajax({
		url : '' + url + "?" + paraStr,
		type : 'post',
		data : {},
		dataType : 'json',
		success : function(result) {
			// console.log("url====>"+this.url);
			// console.log("result====>"+result);
			var optionStr = "<option value=''>---请选择---</option>";
			/* 对返回的结果进行遍历 */
			$.each(result, function(index, element) {
				optionStr += "<option value='" + element.stationID + "'>"
						+ element.stationName + "</option>";
			});
			// $("."+clazz,trObj).empty();
			/* 防止每次拼接之后的无限追加 */
			trObj.find("." + clazz).empty();
			trObj.find("." + clazz).append(optionStr);
		}
	});
}
